import Vue from 'vue'
import Router from 'vue-router'
import Login from '@/view/Login'

Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'Login',
      component: Login
    },
    {
      path:'/Index',
      name:"Index",
      component:()=>import("../view/Index.vue"),
      children:[
        {
          path:'/home',
          name:"home",
          component:()=>import("../view/home.vue")
        },
        {
          path:'/Order',
          name:"Order",
          component:()=>import("../view/Order.vue")
        },
        {
          path:'/Orderdetail/:id',
          name:"Orderdetail",
          component:()=>import("../view/Orderdetail.vue")
        },
        {
          path:'/Goods',
          name:"Goods",
          component:()=>import("../view/Goods.vue")
        },
        {
          path:'/detail/:id',
          name:"detail",
          component:()=>import("../view/detail.vue")
        },
        {
          path:'/categroy/:id?',
          name:"categroy",
          component:()=>import("../view/categroy.vue")
        },
        {
          path:'/users',
          name:"users",
          component:()=>import("../view/users.vue")
        },
        {
          path:'/save',
          name:"save",
          component:()=>import("../view/save.vue")
        },
        {
          path:'/addCate',
          name:"addCate",
          component:()=>import("../view/addCate.vue")
        }
      ],
      meta:{
        title:"首页"
      }
    },
    {
      path:'/ceshi',
      name:"ceshi",
      component:()=>import("../view/ceshi.vue")
    }
   
  ]
})
